<?php

Route::group(['middleware' => ['web','auth:admin'], 'prefix' => 'buy', 'namespace' => 'Modules\Buy\Http\Controllers'], function()
{
    Route::get('/', 'BuyController@index')->name('buy');
    Route::get('buy/login','HomeController@login')->name('login');
});

//arr-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'buy','namespace'=>"Modules\Buy\Http\\Controllers"],
function () {
    Route::resource('arr', 'ArrController');
});
 
//catego-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'buy','namespace'=>"Modules\Buy\Http\\Controllers"],
function () {
    Route::resource('catego', 'CategoController');
});

//good-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'buy','namespace'=>"Modules\Buy\Http\\Controllers"],
function () {
    Route::resource('good', 'GoodController');

});
 
//brand-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'buy','namespace'=>"Modules\Buy\Http\\Controllers"],
function () {
    Route::resource('brand', 'BrandController');
});

 
//huowu-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'buy','namespace'=>"Modules\Buy\Http\\Controllers"],
function () {
    Route::resource('huowu', 'HuowuController');
});


//为当前品牌异步获取所有的分类配路由，你想想，譬如你选择了三星，它究竟是那个分类是不是得获取
Route::get('/good/getbrandcate/{id}','Modules\Buy\Http\Controllers\GoodController@getbrandcate')->name('getbrandcate')->middleware(['web','auth:admin']);

//获取三级分类下面的可用属性
Route::get('/good/getattr/{id}','Modules\Buy\Http\Controllers\GoodController@getattr')->name('getattr')->middleware(['web','auth:admin']);